package vue;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JPanel;

import memory.*;
import modele.MGrid;

public class VLevel extends JPanel {
	
	/*
	 * GUI principale d'une partie
	 */
	
	/*Lien avec le modele*/
	protected MGrid grille;
	
	public VLevel(int h, int l, int th) throws NombreImpairException {
		
		/*Creation d'une grille*/
		grille = new MGrid(h, l, th);
		
		/*Comportement grahique*/
		setBackground(Memory.BG_COLOR);
		GridBagLayout layout = new GridBagLayout();
		GridBagConstraints constraint = new GridBagConstraints();
		constraint.fill = GridBagConstraints.CENTER;
		layout.setConstraints(this, constraint);
		setLayout(layout);
		
		/*Construction de l'interface*/
		VGrid grid = new VGrid(grille);
		add(grid);
		
	}

}
